Skip to content

[cxx-interop] Prevent protocol conformance table from being prematurely populated #83181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

egorzhdan
Copy link
Contributor

We've started seeing build failures where the conformance of a std::vector instantiation to CxxVector is missing. This was because the LifetimeDependenceInfoRequest triggers the protocol conformance table for the instantiation to be built before the synthesized conformance gets added.

This works around the issue by preventing LifetimeDependenceInfoRequest from running for the synthesized default argument generator function, which was the culprit of this particular failure.

rdar://155977071

…ly populated

We've started seeing build failures where the conformance of a `std::vector` instantiation to `CxxVector` is missing. This was because the LifetimeDependenceInfoRequest triggers the protocol conformance table for the instantiation to be built before the synthesized conformance gets added.

This works around the issue by preventing LifetimeDependenceInfoRequest from running for the synthesized default argument generator function, which was the culprit of this particular failure.

rdar://155977071
@egorzhdan egorzhdan requested a review from zoecarver as a code owner July 18, 2025 19:21
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 18, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@slavapestov
Copy link
Contributor

This was because the LifetimeDependenceInfoRequest triggers the protocol conformance table for the instantiation to be built before the synthesized conformance gets added.

you’re adding the synthesized conformance in the wrong place.

@Xazax-hun
Copy link
Contributor

This fix looks reasonable for me for the acute issue. We talked offline about a couple of potential alternative solutions but I think it is OK to explore those in follow-up PRs.

@egorzhdan egorzhdan merged commit 04726c0 into swiftlang:main Jul 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants